<script setup lang="ts">
interface PromotionBadgeProps {
  text?: string
}

withDefaults(defineProps<PromotionBadgeProps>(), {
  text: '限时优惠'
})
</script>

<template>
  <div class="promotion-badge">
    <span class="badge-text">{{ text }}</span>
  </div>
</template>

<style scoped>
.promotion-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(255, 82, 82, 0.4);
  z-index: 10;
  animation: pulse 2s ease-in-out infinite;
  white-space: nowrap;
}

.badge-text {
  display: inline-block;
  letter-spacing: 0.5px;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(255, 82, 82, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 82, 82, 0.6);
  }
}

@media (max-width: 768px) {
  .promotion-badge {
    top: -6px;
    right: -6px;
    padding: 6px 12px;
    font-size: 12px;
  }
}
</style>
